<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<h1>
	<fmt:message key="security.login.page.title" />
</h1>
<div class='loginContent'>

	<div class='inner'>
		<c:if test="${not empty loginErrorMessage}">
			<div class="login_message">
				<fmt:message key="security.unableToLogin" />
				:<br />
				<c:out value="${loginErrorMessage}" />
			</div>
		</c:if>

		<form action="<c:url value="/users/login/authenticate" />"
			method="post" id='loginForm' class="loginForm">
			<table class="loginTable">
				<tbody>
					<tr>
						<td class="loginLabel"><fmt:message
								key="security.login.label" /></td>
						<td align="left"><input type="text" name="j_username"
							id="j_username" class="loginInput" /></td>
					</tr>
					<tr>
						<td class="loginLabel"><fmt:message
								key="security.password.label" /></td>
						<td align="left"><input name="j_password" id="j_password"
							type="password" class="loginInput" /></td>
					</tr>
					<tr>
						<td align="right"><input style="text-align: right;"
							type='checkbox' class="loginInput"
							name="_spring_security_remember_me" id='remember_me' />
						</td>
						<td valign="middle" nowrap="nowrap"><fmt:message
								key="security.rememberMe.label" /></td>
					</tr>
					<tr>
						<td></td>
						<td><button class="loginButton" id="submit" type="submit">
								<fmt:message key="security.action.login.label" />
							</button>
						</td>
					</tr>
				</tbody>
			</table>
		</form>
		
		<a class="simpleLink" href="<c:url value="/users/createUser" />"><fmt:message
							key="security.users.createUser.link" /> </a>
	</div>
</div>
<script type='text/javascript'>
<!--
	(function() {
		document.forms['loginForm'].elements['j_username'].focus();
	})();
// -->
</script>
